package a.h;

import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
import java.io.IOException;
import java.net.URL;

public class sb
  implements Icon, ListCellRenderer, TableCellRenderer
{
  int a;
  int c;
  private Image d;
  private int f;
  private int h;
  private DefaultListCellRenderer i = new DefaultListCellRenderer();
  private DefaultTableCellRenderer j = new DefaultTableCellRenderer();
  private ob k;
  private String l;
  public static boolean m;
  
  public sb(ob paramob, int paramInt1, int paramInt2)
  {
    if (n == 0)
    {
      this.k = paramob;
      if (paramob == null)
      {
        this.l = dc.a().b("IMAGE_OPTION_ITEM.NO_IMAGE");
        if (n != 0) {
          return;
        }
        if (!ec.s) {
          break label82;
        }
      }
    }
    this.l = paramob.b("IMAGE_OPTION_ITEM.NO_IMAGE");
    label82:
    this.a = paramInt1;
    this.c = paramInt2;
  }
  
  public Component getListCellRendererComponent(JList paramJList, Object paramObject, int paramInt, boolean paramBoolean1, boolean paramBoolean2)
  {
    int n = ec.t;
    boolean bool = ec.s;
    this.i.getListCellRendererComponent(paramJList, "", paramInt, paramBoolean1, paramBoolean2);
    if (n == 0)
    {
      if (paramObject == null)
      {
        this.i.setIcon(null);
        this.i.setText(" ");
        this.d = null;
        return this.i;
      }
      this.d = null;
    }
    if (n == 0) {
      if ((paramObject instanceof ed))
      {
        if (n != 0) {
          break label159;
        }
        this.d = ((ed)paramObject).a();
        if (!bool) {
          break label158;
        }
      }
    }
    if (n == 0) {
      if ((paramObject instanceof Image))
      {
        if (n != 0) {
          break label159;
        }
        this.d = ((Image)paramObject);
      }
    }
    if ((bool) && ((paramObject instanceof URL))) {
      try
      {
        this.d = ImageIO.read((URL)paramObject);
      }
      catch (IOException localIOException)
      {
        this.d = null;
      }
    }
    label158:
    label159:
    if (n == 0)
    {
      if (this.d != null)
      {
        this.f = this.d.getWidth(this.i);
        this.h = this.d.getHeight(this.i);
        if (n == 0) {
          if (this.f > this.h)
          {
            d1 = this.f / this.a;
            this.f = this.a;
            this.h = ((int)(this.h / d1));
            if (n != 0) {
              break label309;
            }
            if (!bool) {
              break label294;
            }
          }
        }
        double d1 = this.h / this.c;
        this.f = ((int)(this.f / d1));
        this.h = this.c;
        label294:
        if (n != 0) {
          break label333;
        }
        this.i.setIcon(this);
        label309:
        if (!bool) {}
      }
      else
      {
        this.i.setIcon(null);
      }
    }
    else {
      this.i.setText("");
    }
    label333:
    return this.i;
  }
  
  public void paintIcon(Component paramComponent, Graphics paramGraphics, int paramInt1, int paramInt2)
  {
    int n = ec.t;
    if (this.d != null)
    {
      if (n == 0) {
        if (paramComponent.getHeight() < this.h)
        {
          float f1 = paramComponent.getHeight() / this.h;
          paramGraphics.drawImage(this.d, paramInt1, (int)(paramInt2 + this.h * 0.5F * (1.0F - f1)), (int)(this.f * f1), (int)(this.h * f1), paramComponent);
          if ((n == 0) && (!ec.s)) {
            return;
          }
        }
      }
      paramGraphics.drawImage(this.d, paramInt1, paramInt2, this.f, this.h, paramComponent);
    }
  }
  
  public int getIconWidth()
  {
    return this.f;
  }
  
  public int getIconHeight()
  {
    return this.h;
  }
  
  public Component getTableCellRendererComponent(JTable paramJTable, Object paramObject, boolean paramBoolean1, boolean paramBoolean2, int paramInt1, int paramInt2)
  {
    int n = ec.t;
    boolean bool = ec.s;
    if (n == 0)
    {
      if (paramObject != null)
      {
        this.d = null;
        localObject1 = paramObject.toString();
        if (n == 0) {
          if ((paramObject instanceof ed))
          {
            ed localed = (ed)paramObject;
            if (n == 0)
            {
              if (localed.c())
              {
                this.j.setIcon(null);
                localObject2 = (JComponent)this.j.getTableCellRendererComponent(paramJTable, this.l, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
                ((JComponent)localObject2).setToolTipText(null);
                return localObject2;
              }
              this.d = localed.a();
            }
            Object localObject2 = localed.b();
            if (n == 0) {
              if (localObject2 == null)
              {
                localObject1 = null;
                break label209;
              }
            }
            localObject1 = ((URL)localObject2).toString();
            if ((n == 0) && (!bool)) {
              break label209;
            }
          }
        }
        if (n == 0) {
          if ((paramObject instanceof Image))
          {
            if (n != 0) {
              break label210;
            }
            this.d = ((Image)paramObject);
          }
        }
        if ((bool) && ((paramObject instanceof URL))) {
          try
          {
            this.d = ImageIO.read((URL)paramObject);
          }
          catch (IOException localIOException)
          {
            this.d = null;
          }
        }
        label209:
        label210:
        JComponent localJComponent = (JComponent)this.j.getTableCellRendererComponent(paramJTable, "", paramBoolean1, paramBoolean2, paramInt1, paramInt2);
        if (n == 0) {
          if (this.d != null)
          {
            this.f = this.d.getWidth(this.i);
            this.h = this.d.getHeight(this.i);
            if (n == 0) {
              if (this.f > this.h)
              {
                d1 = this.f / 48.0D;
                this.f = 48;
                this.h = ((int)(this.h / d1));
                if (n != 0) {
                  break label383;
                }
                if (!bool) {
                  break label359;
                }
              }
            }
            double d1 = this.h / 48.0D;
            this.f = ((int)(this.f / d1));
            this.h = 48;
            label359:
            this.j.setIcon(this);
            this.j.setText("");
            if (n != 0) {
              break label401;
            }
            label383:
            if (!bool) {
              break label394;
            }
          }
        }
        this.j.setIcon(null);
        label394:
        localJComponent.setToolTipText((String)localObject1);
        label401:
        return localJComponent;
      }
      this.j.setIcon(null);
    }
    Object localObject1 = (JComponent)this.j.getTableCellRendererComponent(paramJTable, this.l, paramBoolean1, paramBoolean2, paramInt1, paramInt2);
    ((JComponent)localObject1).setToolTipText(null);
    return localObject1;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.sb

 * JD-Core Version:    0.7.0.1

 */